Shores of Tripoli
The Marine Hymn should remind us that America has a problem with Islam that dates back to the founding of our nation. Before that, Britain, as our “Mother Country”, dealt with the problem of Islamic state sponsored piracy. Either you paid tribute to the Barbary States or they raided and seized your ships and sailors. You could consider the tribute that was paid the maritime version of the jizya, the tax infidels pay to not be molested by Muslims.
The Tripolitan ambassador to London made it clear in a conversation with Thomas Jefferson and John Adams that as Muslims, they had a right and duty to plunder and enslave infidels. That was the only reason they needed to make war. This was in 1786.
The reason to stop making war didn’t arrive until the Barbary States were defeated by the American Navy and Marines in 1805. After the First Barbary War, the United States enjoyed a brief period of safe passage for commercial shipping in the Mediterranean. That changed during the War of 1812 when the Barbary States saw an opportunity to exploit the absence of American naval power in the Mediterranean.